
// Copyright (C) 2007 Richard Uhler
// This file is part of Esiply.
//
// Esiply is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License, Version 2,
// as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

#ifndef _SOURCE_ELEMENTS_H_
#define _SOURCE_ELEMENTS_H_
#define GC_THREADS
// Source elements holds a list of statements to execute,
// and a list of function declarations, to deal with just
// before executing the statements.

//#include <gc_cpp.h>
#include <vector>

#include "FunctionDeclaration.h"
#include "Statement.h"

class SourceElement;

class SourceElements  
{
public:
    SourceElements(SourceElement* element);
    void push_back(SourceElement* element);
    Value* run(Scope* scope);

    void setLineNumber(int line);

    void setFile(String* file);


private:
    std::vector<Statement*> m_stmts;
    std::vector<FunctionDeclaration*> m_fdecs;

    // This is just so we can clean up when we are done.
    std::vector<SourceElement*> m_elements;
    int m_line_number;
    String* m_file;
};

#endif//_SOURCE_ELEMENTS_H_

